<template>
<div>
    <div class="demo-input-size">
        <el-input
            placeholder="标题"
            suffix-icon="el-icon-search"
            v-model="input">
        </el-input>
    </div>
    <div class="button">
        <el-button  icon="el-icon-more"></el-button>
        <el-button  icon="el-icon-more"></el-button>
        <el-button  icon="el-icon-refresh"></el-button>
        <el-button  icon="el-icon-refresh"></el-button>
        <el-button  icon="el-icon-refresh"></el-button>
    </div>  
    
    <div>
        <el-table  style="width: 100%"  border
            v-loading="loading"
            :data="tableData.slice((pageNum - 1) * pageSize, pageNum * pageSize)"
        >
            
            <el-table-column type="index" prop="id" label="序号" ></el-table-column>
            <el-table-column prop="plcCode" label="PLC" width="180"></el-table-column> 
            <el-table-column prop="contentCn" label="内容" width="360"></el-table-column>
            <el-table-column prop="assetName" label="设备"></el-table-column>
            <el-table-column prop="attributeCode" label="点位"></el-table-column>
            <el-table-column prop="assetTypeName" label="设备类型"></el-table-column>
            <el-table-column prop="title" label="标题"></el-table-column>
            <el-table-column prop="levelLabel" label="级别"></el-table-column>
            <el-table-column prop="happenTime" label="发生时间"></el-table-column>
            <el-table-column prop="recoverTime" label="恢复时间"></el-table-column>
            <el-table-column prop="handlerTime" label="持续时间"></el-table-column>
            <el-table-column prop="handler" label="确认人"></el-table-column>
            <el-table-column prop="address" label="确认时间"></el-table-column>
            <el-table-column prop="address" label="ID"></el-table-column>
        </el-table>
        <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="pageNum"
      :limit.sync="pageSize"
    />
    </div>
</div>
</template>
<script>
import { realTime } from "../../api/realTime";
    export default {
        data() {
            return {
                input: '',
                tableData: [],
                pageNum: 1,
                pageSize: 10,
                total: 0
            }
        },
        created() {
    this.getList();
  },
        methods: {
    /** 查询介质能耗 */
    getList() {
      
      realTime().then((response) => {
        console.log(response);
        this.tableData = response.rows;
        console.log(this.tableData);
        this.total = response.total;
        this.loading = false;
      });
    },
  },
    }
</script>
<style scoped>
    .demo-input-size{
        width: 20%;
        margin-left: 54.5%;
        margin-top: 10px;
    }
    .button{
        margin-top: -36px;
        margin-left: 75%;
    }
</style>
